<template>
  <div>
<p>国内网站粉丝数量：<span>{{num |fansNum(str)}}</span></p>
<p>国外网站粉丝数量：<span>{{num |fansNum}}</span></p>
<hr>
<p>时间：<span>{{time |dataTime(time1)}}</span></p>
<p>时间：<span>{{time |dataTime}}</span></p>
  </div>
</template>

<script>
import moment from 'moment'
export default {
  data () {
    return {
      num: 1876986,
      time: Date.now(),
      str: '万',
      time1: 1
    }
  },

  filters: {
    fansNum (val, string) {
      if (string === '万') {
        return (val / 10000) + '万'
      } else {
        return (val / 1000) + '千'
      }
    },
    dataTime (val, ti) {
      if (ti) {
        return moment(parseInt(val)).format('YYYY-MM-DD hh:mm:ss')
      } else {
        return moment(parseInt(val)).format('YYYY/MM/DD hh:mm:ss')
      }
    }

  },

  methods: {

  }
}
</script>

<style scoped lang='less'>

</style>
